package com.yonyou.cyxdms.basedata.service.dto;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yonyou.cyx.framework.bean.dto.base.BaseDTO;
import com.yonyou.cyx.framework.bean.entity.base.BasePO;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyx.function.utils.jsonserializer.localdatetime.JsonLocalDateTimeDeserializer;
import com.yonyou.cyx.function.utils.jsonserializer.localdatetime.JsonLocalDateTimeSerializer;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;


/**
 * <p>
 * 车配置表
 * </p>
 *
 * @author guorp1
 * @since 2018-11-12
 */

public class ConfigureDTO extends BaseDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 配置ID
     */
    private Long configureId;
    /**
     * 车型ID
     */
    private Long modelId;
    /**
     * 配置代码
     */
    private String configureCode;
    /**
     * 配置名称
     */
    private String configureName;
    /**
     * 是否有效  是：10041001 否：10041002
     */
    private Integer isValid;
    /**
     * 含税采购价
     */
    private BigDecimal taxPurchasePrice;
    /**
     * 来源ID
     */
    private Long sourceId;
    /**
     * 来源渠道
     */
    private Integer sourceChannel;
    @JsonDeserialize(using = JsonLocalDateTimeDeserializer.class)
    @JsonSerialize(using = JsonLocalDateTimeSerializer.class)
    private LocalDateTime sourceChangedAt;
    /**
     * 创建日期
     */
    @JsonDeserialize(using = JsonLocalDateTimeDeserializer.class)
    @JsonSerialize(using = JsonLocalDateTimeSerializer.class)
    private LocalDateTime createdTime;
    /**
     * 更新日期
     */
    @JsonDeserialize(using = JsonLocalDateTimeDeserializer.class)
    @JsonSerialize(using = JsonLocalDateTimeSerializer.class)
    private LocalDateTime updatedTime;
    /**
     * 是否删除
     */
    private Integer isDeleted;
    /**
     * 是否加装
     */
    private String isRefit;
    /**
     * 排量
     */
    private String displacement;
    /**
     * 变速箱
     */
    private String transMission;
    /**
     * 驱动方式
     */
    private String driveApproach;
    /**
     * 配置级别
     */
    private String grade;
    /**
     * 车身
     */
    private String carBody;
    /**
     * 生效日期 yyyy-MM-dd
     */
    @JsonDeserialize(using = JsonLocalDateTimeDeserializer.class)
    @JsonSerialize(using = JsonLocalDateTimeSerializer.class)
    private LocalDateTime enableDate;
    /**
     * 失效日期 yyyy-MM-dd
     */
    @JsonDeserialize(using = JsonLocalDateTimeDeserializer.class)
    @JsonSerialize(using = JsonLocalDateTimeSerializer.class)
    private LocalDateTime disableDate;
    /**
     * 燃料方式
     */
    private String fuelWay;
    private Integer packageId;

    /**
     * 时间戳
     */
    @JsonDeserialize(using = JsonLocalDateTimeDeserializer.class)
    @JsonSerialize(using = JsonLocalDateTimeSerializer.class)
    private LocalDateTime changeAt;


    /**
     * 后续的方法
     */
    private Integer method;

    private String bizId;

    private ModelDTO modelDTO;

    public ConfigureDTO() {
        super();
    }


    public Long getConfigureId() {
        return configureId;
    }


    public void setConfigureId(Long configureId) {
        this.configureId = configureId;
    }


    public Long getModelId() {
        return modelId;
    }


    public void setModelId(Long modelId) {
        this.modelId = modelId;
    }


    public String getConfigureCode() {
        return configureCode;
    }


    public void setConfigureCode(String configureCode) {
        this.configureCode = configureCode;
    }


    public String getConfigureName() {
        return configureName;
    }

    public void setConfigureName(String configureName) {
        this.configureName = configureName;
    }

    public Integer getMethod() {
        return method;
    }

    public void setMethod(Integer method) {
        this.method = method;
    }

    public String getBizId() {
        return bizId;
    }

    public void setBizId(String bizId) {
        this.bizId = bizId;
    }

    public Integer getIsValid() {
        return isValid;
    }


    public void setIsValid(Integer isValid) {
        this.isValid = isValid;
    }


    public BigDecimal getTaxPurchasePrice() {
        return taxPurchasePrice;
    }


    public void setTaxPurchasePrice(BigDecimal taxPurchasePrice) {
        this.taxPurchasePrice = taxPurchasePrice;
    }

    public ModelDTO getModelDTO() {
        return modelDTO;
    }

    public void setModelDTO(ModelDTO modelDTO) {
        this.modelDTO = modelDTO;
    }

    public Long getSourceId() {
        return sourceId;
    }


    public void setSourceId(Long sourceId) {
        this.sourceId = sourceId;
    }


    public Integer getSourceChannel() {
        return sourceChannel;
    }


    public void setSourceChannel(Integer sourceChannel) {
        this.sourceChannel = sourceChannel;
    }


    public LocalDateTime getSourceChangedAt() {
        return sourceChangedAt;
    }


    public void setSourceChangedAt(LocalDateTime sourceChangedAt) {
        this.sourceChangedAt = sourceChangedAt;
    }


    public LocalDateTime getCreatedTime() {
        return createdTime;
    }


    public void setCreatedTime(LocalDateTime createdTime) {
        this.createdTime = createdTime;
    }


    public LocalDateTime getUpdatedTime() {
        return updatedTime;
    }


    public void setUpdatedTime(LocalDateTime updatedTime) {
        this.updatedTime = updatedTime;
    }


    public Integer getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    public String getIsRefit() {
        return isRefit;
    }


    public void setIsRefit(String isRefit) {
        this.isRefit = isRefit;
    }


    public String getDisplacement() {
        return displacement;
    }


    public void setDisplacement(String displacement) {
        this.displacement = displacement;
    }


    public String getTransMission() {
        return transMission;
    }

    public void setTransMission(String transMission) {
        this.transMission = transMission;
    }

    public String getDriveApproach() {
        return driveApproach;
    }


    public void setDriveApproach(String driveApproach) {
        this.driveApproach = driveApproach;
    }


    public String getGrade() {
        return grade;
    }


    public void setGrade(String grade) {
        this.grade = grade;
    }


    public String getCarBody() {
        return carBody;
    }


    public void setCarBody(String carBody) {
        this.carBody = carBody;
    }


    public LocalDateTime getEnableDate() {
        return enableDate;
    }


    public void setEnableDate(LocalDateTime enableDate) {
        this.enableDate = enableDate;
    }


    public LocalDateTime getDisableDate() {
        return disableDate;
    }


    public void setDisableDate(LocalDateTime disableDate) {
        this.disableDate = disableDate;
    }


    public String getFuelWay() {
        return fuelWay;
    }


    public void setFuelWay(String fuelWay) {
        this.fuelWay = fuelWay;
    }


    public Integer getPackageId() {
        return packageId;
    }


    public void setPackageId(Integer packageId) {
        this.packageId = packageId;
    }


    public LocalDateTime getChangeAt() {
        return changeAt;
    }


    public void setChangeAt(LocalDateTime changeAt) {
        this.changeAt = changeAt;
    }


    @Override
    public String toString() {
        return "ConfigureDTO{" +
                "configureId=" + configureId +
                ", modelId=" + modelId +
                ", configureCode='" + configureCode + '\'' +
                ", configureName='" + configureName + '\'' +
                ", isValid=" + isValid +
                ", taxPurchasePrice=" + taxPurchasePrice +
                ", sourceId=" + sourceId +
                ", sourceChannel=" + sourceChannel +
                ", sourceChangedAt=" + sourceChangedAt +
                ", createdTime=" + createdTime +
                ", updatedTime=" + updatedTime +
                ", isDeleted=" + isDeleted +
                ", isRefit='" + isRefit + '\'' +
                ", displacement='" + displacement + '\'' +
                ", transMission='" + transMission + '\'' +
                ", driveApproach='" + driveApproach + '\'' +
                ", grade='" + grade + '\'' +
                ", carBody='" + carBody + '\'' +
                ", enableDate=" + enableDate +
                ", disableDate=" + disableDate +
                ", fuelWay='" + fuelWay + '\'' +
                ", packageId=" + packageId +
                ", changeAt=" + changeAt +
                ", method=" + method +
                ", bizId='" + bizId + '\'' +
                ", modelDTO=" + modelDTO +
                '}';
    }

    /**
     * 将DTO 转换为PO
     * //对某个对象属性进行赋值
     * //BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     *
     * @param poClass dto 需要转换的dto
     * @author guorp1
     * @since 2018/7/22 0022
     */
    @Override
    public <T extends BasePO> T transDtoToPo(Class<T> poClass) {
        return super.transDtoToPo(poClass);
    }

    /**
     * 将DTO 转换为PO
     * BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     *
     * @param po 需要转换的对象
     * @author guorp1
     * @since 2018/7/22 0022
     */
    public <T extends BasePO> void transDtoToPo(T po) {
        BeanMapperUtil.copyProperties(this, po, "configureId");
    }

}
